function getdetail() {
  $.ajax({
    url: baseUrl + "/faultList",
    type: "POST",
    dataType: "json",
    success: function (data) {
      detailData(data.data);
    },
    // 超时时间
    timeout: 4000,
    // 失败的回调
    error: function () {
      alert("请求数据失败！");
    },
  });
}
function detailData(res) {
  $("#detail_list>ul").empty(); //清楚列表数据
  let arr = [];
  arr = [
    {
      name: 1,
      equipment_id: 1,
      equipment: {
        name: 1,
      },
      equipment: {
        marking: 1,
      },
    },
  ];
  res.forEach((item) => {
    $("#detail_list>ul").append(`<li>
      <div>${item.name}</div>
      <div>${item.equipment_id}</div>
      <div>${item.equipment.name}</div>
      <div>${item.equipment.marking}</div>
      </li>`);
  });
  $(function () {
    if (res.length > 4) {
      setInterval('autoScrollC("#detail_list")', 2000);
    }
  });
}
function autoScrollC(obj) {
  $(obj)
    .find("ul")
    .animate(
      {
        marginTop: "-3rem",
      },
      500,
      function () {
        $(this).css({ marginTop: "0px" }).find("li:first").appendTo(this);
      }
    );
}
